package vd.cloud.com.services;

import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import vd.cloud.com.dto.KidDTO;

import java.util.GregorianCalendar;

/**
 * Created with IntelliJ IDEA.
 * User: VIET
 * Date: 4/12/14
 * Time: 10:51 AM
 * To change this template use File | Settings | File Templates.
 */
@Service
@RequestMapping("/test")
public class Test {

    @RequestMapping(method = RequestMethod.GET,value = "hello")
    @ResponseBody
    public  String hello(){
        return "hello";
    }

    @RequestMapping(value="/kids",method = RequestMethod.GET)
    @ResponseBody
    public KidDTO kid(@RequestParam("name") String name){
        KidDTO kidDTO = new KidDTO();
        kidDTO.setName(name);
        kidDTO.setBirthDay(new GregorianCalendar());
        return kidDTO;
    }

}
